package util

import "io/ioutil"

//ReadAllFile 读取文件全部内容
func ReadAllFile(filePath string) ([]byte, error) {
	if fileContent, err := ioutil.ReadFile(filePath); err != nil {
		return nil, err
	} else {
		return fileContent, nil
	}
}

func ReadFileAsString(filePath string) (string, error) {
	fileContent, err := ReadAllFile(filePath)
	if err != nil {
		return "", err
	}
	return string(fileContent), nil
}
